﻿<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="$prjsn$.Entity.Services" assembly="$prjsn$.Entity">

    <class name="Translator" table="ServicesTranslator" lazy="true">
        <cache usage="read-write" region="ShortTerm" />
        <id name="ID" column="TranslatorId">
            <generator class="native"></generator>
        </id>

        <property name="Key" not-null="true" length="250" column="KeyColumn" />
        <property name="Area" not-null="true" length="250" />

        <map name="Translations" access="property" table="ServicesTranslations" lazy="true"
             batch-size="25">
            <key column="TranslatorId" />
            <index column="LanguageName" type="System.String" length="5" />
            <element column="Translation" type="System.String" length="2000" />
        </map>

        <bag name="Phrases" inverse="true" lazy="true" cascade="none">
            <key column="TranslatorId" />
            <one-to-many class="Phrase" />
        </bag>
    </class>

    <class name="Phrase" table="ServicesTranslations" lazy="true">
        <id name="ID" column="TranslationsId">
            <generator class="native"></generator>
        </id>

        <property name="Language" not-null="true" column="LanguageName"></property>
        <property name="Localization" not-null="true" column="Translation"></property>

        <many-to-one name="Translator" column="TranslatorId" lazy="false" class="Translator"></many-to-one>
    </class>
</hibernate-mapping>